#!/bin/bash
set -x
OSDP_PATH=/opt/osdp-conformance
CMDPATH=${OSDP_PATH}/tmp/open_osdp_command.json
CMDPATHX=${OSDP_PATH}/run/CP/open_osdp_command.json

OUI=5c2623",
CMD_GENAUTH=14
DETAILS_CHALLENGE=0A0100000A019E077c82010682008182010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d2d2d2d2d434f4e464f524d414e43452d2d2d2d
  "#" : "_end"
}



echo  >${CMDPATH} "{"
echo >>${CMDPATH} "  \"command\" : \"mfg\","
echo >>${CMDPATH} "  \"oui\" : \"${OUI}\","
echo >>${CMDPATH} "  \"command-id\" : \"${CMD_CHALLENGE}\","
echo >>${CMDPATH} "  \"command-specific-data\" : \"${DETAILS_CHALLENGE}\""
echo >>${CMDPATH} "}"
sudo -n cp ${CMDPATH} ${CMDPATHX}
sudo -n ${OSDP_PATH}/bin/HUP-CP

